#include "adc_app.h"
uint32_t adc_buffer[30];
uint32_t adc_value;
float volt;//电压值
void adc_proc(void)
{
	adc_value = 0;
	for(int i=0;i<30;i++)
	{
		adc_value += adc_buffer[i];
	}
	adc_value /= 30.0f;
	volt = adc_value / 4096.0f * 3.3f;

	if(!duty_lock)
	{
		if (volt >= 3.00f)
			duty = 85;
		else if (volt >= 1.0f)
			duty = (uint16_t)(37.50f * volt - 27.50f);
		else if (volt >= 0)
			duty = 10;		
	}

}